set(HELLO_SRCS hello.c)

add_library(hello_shared SHARED ${HELLO_SRCS})
add_library(hello_static STATIC ${HELLO_SRCS})

# 将库的输出文件名改为 hello
set_target_properties(hello_shared PROPERTIES OUTPUT_NAME "hello")
set_target_properties(hello_static PROPERTIES OUTPUT_NAME "hello")

# 动态库版本号
set_target_properties(hello_shared PROPERTIES VERSION 1.2 SOVERSION 1)

set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)

# 安装库文件
install(TARGETS hello_shared hello_static
        LIBRARY DESTINATION lib
        ARCHIVE DESTINATION lib)

# 安装头文件
install(FILES hello.h DESTINATION include/hello)
